<?php if (!defined('THINK_PATH')) exit();?><html>
<head>
<title>商品管理</title>
    <script src="/drclothes/Public/js/jquery.min.js"></script>    
    <script src="/drclothes/Public/js/bootstrap.min.js"></script>  
    <link href="/drclothes/Public/css/bootstrap.min.css" rel="stylesheet">
    <link href="/drclothes/Public/css/admin.css" rel="stylesheet">
</head>
<body>
    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container-fluid">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">Drclothes商城后台管理系统</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <ul class="nav navbar-nav navbar-right">
    <li><a>您好，<?php echo I('session.usernameA'); ?></a></li>
    <li><a href="/drclothes/index.php/admin/form/logout">退出</a></li>
</ul>
        </div>
      </div>
    </nav>

    <div class="container-fluid">
      <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
          <ul class="nav nav-sidebar">
              <li><a href="/drclothes/index.php/admin">首页</a></li>
              <li><a href="/drclothes/index.php/admin/Slideshow">首页轮播图管理</a></li>
              <li class="active"><a href="/drclothes/index.php/admin/drclothes">商品管理</a></li>
              <li><a href="/drclothes/index.php/admin/User">用户管理</a></li>
              <li><a href="/drclothes/index.php/admin/Order">订单管理</a></li>
              <li><a href="/drclothes/index.php/admin/News">公告列表</a></li>
              <li><a href="/drclothes/index.php/admin/Comment">评论管理</a></li>
          </ul>
        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
          <p class="pull-right" style="margin-top: 20px;"><a class="btn btn-success" href="/drclothes/index.php/Admin/drclothes/add">添加</a><button class="btn button2" type="button" id="deleteA">批量删除</button></p>
          <h2 class="sub-header">商品管理</h2>
          <div class="table-responsive">
            <table class="table table-striped table-hover">
              <thead>
                <tr>
                  <th><input class="all" type="checkbox"/></th>
                  <th>#</th>
                  <th>商品名</th>
                  <th>描述</th>
                  <th>价格</th>
                  <th>图片</th>
                  <th>管理</th>
                </tr>
              </thead>
              <tbody>
                <form action="/drclothes/index.php/admin/drclothes/delete_all" method="get" id="list">
                <?php if(is_array($list)): $k = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "$empty" ;else: foreach($__LIST__ as $key=>$item): $mod = ($k % 2 );++$k;?><tr>
                  <td><input name='id[]' type='checkbox' value='<?php echo ($item["id"]); ?>' class="noborder"></td>
                  <td><?php echo ($k); ?></td>
                  <td><?php echo ($item["name"]); ?></td>
                  <td><?php echo ($item["description"]); ?></td>
                  <td><?php echo ($item["price"]); ?></td>
                  <td><img class="img-rounded" style="height:25%;width:auto;" src="/drclothes/Public/<?php echo ($item["img"]); ?>"/></td>
                  <td><a class="btn btn-info" href="/drclothes/index.php/home/index/drclothes?id=<?php echo ($item["id"]); ?>" target="_blank">查看</a><a class="btn btn-primary" href="/drclothes/index.php/Admin/drclothes/change?id=<?php echo ($item["id"]); ?>">修改</a><a class="btn button2" href="/drclothes/index.php/Admin/drclothes/delete?id=<?php echo ($item["id"]); ?>">删除</a></td>
                </tr><?php endforeach; endif; else: echo "$empty" ;endif; ?>
                </form>
              </tbody>
            </table>

          </div>
        <div class="pages">
            <?php echo ($page); ?>
        </div>
        </div>
      </div>
    </div>
  <script type="text/javascript">
    $('.all').click(function() {
      if($(this).is(':checked')) {
        $(':checkbox').attr('checked', 'checked');
      } else {
        $(':checkbox').removeAttr('checked');
      }
    });
    $('#deleteA').click(function() {
    if($(':checked').size() > 0) {
      $("#list").submit();
    } else {
      alert('没有选择！');
    }
  });

  </script>
</body>
</html>